// N1AutoreleasePool.h: interface for the N1AutoreleasePool class.
//
//////////////////////////////////////////////////////////////////////

#ifndef N1AUTORELEASEPOOL_H__86
#define N1AUTORELEASEPOOL_H__86

#include <list>
#include "N1Lib.h"

class N1AutoreleasePool : public N1Object {
    typedef std::list<N1Object*> PoolList;
    PoolList            m_list;
    N1AutoreleasePool  *m_prevPool;

    void addObject(N1Object *obj);

public:
    N1AutoreleasePool();
    virtual ~N1AutoreleasePool();

    N1NAME_DECL

    uint32 clear();

    static void add(N1Object *obj);

    static N1AutoreleasePool*  defaultPool();
};


#endif // N1AUTORELEASEPOOL_H__86
